<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


<!-- remove old header -->


<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>cogen API Reference Documentation
        - Class: Scheduler</title><meta name="MSSmartTagsPreventParsing" content="true" /><meta http-equiv="imagetoolbar" content="no" /><link href="css/default.css" rel="stylesheet" type="text/css" /><link href="css/pygments.css" rel="stylesheet" type="text/css" />
    <!-- <link rel="shortcut icon" href="/images/favicon.ico" type="image/vnd.microsoft.icon"/> -->
    <link rel="stylesheet" href="css/apydia.css" type="text/css" />
    <script src="js/jquery-1.2.1.pack.js" type="text/javascript"></script>
    <script src="js/apydia.js" type="text/javascript"></script>
	<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
</head>
<body>
    <div id="page">
        <div id="browser">
            <div class="browser-section">
                <h2>Module Index</h2>
                <ul>
                    <li>
                        <a href="cogen.html">cogen</a>
                    </li><li>
                        <a href="cogen.common.html">cogen.common</a>
                    </li><li>
                        <a href="cogen.core.html">cogen.core</a>
                    </li><li>
                        <a href="cogen.core.coroutine.html">cogen.core.coroutine</a>
                    </li><li>
                        <a href="cogen.core.events.html">cogen.core.events</a>
                    </li><li>
                        <a href="cogen.core.queue.html">cogen.core.queue</a>
                    </li><li>
                        <a href="cogen.core.reactors.html">cogen.core.reactors</a>
                    </li><li class="active">
                        <a href="cogen.core.schedulers.html">cogen.core.schedulers</a>
                    </li><li>
                        <a href="cogen.core.sockets.html">cogen.core.sockets</a>
                    </li><li>
                        <a href="cogen.core.util.html">cogen.core.util</a>
                    </li><li>
                        <a href="cogen.web.html">cogen.web</a>
                    </li><li>
                        <a href="cogen.web.async.html">cogen.web.async</a>
                    </li><li>
                        <a href="cogen.web.wsgi.html">cogen.web.wsgi</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Methods</h2>
                <ul>
                    <li>
                        <a href="cogen.core.schedulers.Scheduler.html#method-add">add</a>
                    </li><li>
                        <a href="cogen.core.schedulers.Scheduler.html#method-add_timeout">add_timeout</a>
                    </li><li>
                        <a href="cogen.core.schedulers.Scheduler.html#method-handle_timeouts">handle_timeouts</a>
                    </li><li>
                        <a href="cogen.core.schedulers.Scheduler.html#method-next_timer_delta">next_timer_delta</a>
                    </li><li>
                        <a href="cogen.core.schedulers.Scheduler.html#method-process_op">process_op</a>
                    </li><li>
                        <a href="cogen.core.schedulers.Scheduler.html#method-run">run</a>
                    </li><li>
                        <a href="cogen.core.schedulers.Scheduler.html#method-run_timer">run_timer</a>
                    </li><li>
                        <a href="cogen.core.schedulers.Scheduler.html#method-stop">stop</a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content">
    <h1>Class: cogen.core.schedulers.Scheduler</h1>
    <div class="docstring plain">Basic deque-based scheduler with timeout support and primitive
prioritisaiton parameters.<br /><br />Usage:
<code class="codeblock python python python python python python python python python python python python python python python python" name="code">Scheduler(reactor=DefaultReactor, default_priority=priority.LAST, default_timeout=None)</code><ul><li> reactor: a reactor class to use</li><li> default_priority: a default priority option for operations that do not </li></ul><blockquote>set it. check <a href="Docs_CogenCoreUtilPriority.html">priority</a>.</blockquote><ul><li> default_timeout: a default timedelta or number of seconds to wait for </li></ul><blockquote>the operation</blockquote></div>
    <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\schedulers.py#L52">View source</a>
    </li>
</ul>
    <div>
        <h2>Methods</h2>
            <h3 id="method-add">
                add
                <span class="args">(self, coro, args=(), kwargs={}, first=True)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\schedulers.py#L91">View source</a>
    </li>
</ul>
            <h3 id="method-add_timeout">
                add_timeout
                <span class="args">(self, op, coro, weak_timeout)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\schedulers.py#L120">View source</a>
    </li>
</ul>
            <h3 id="method-handle_timeouts">
                handle_timeouts
                <span class="args">(self)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\schedulers.py#L122">View source</a>
    </li>
</ul>
            <h3 id="method-next_timer_delta">
                next_timer_delta
                <span class="args">(self)</span>
            </h3>
            <div class="docstring plain">~ @debug(0)
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\schedulers.py#L106">View source</a>
    </li>
</ul>
            <h3 id="method-process_op">
                process_op
                <span class="args">(self, op, coro)</span>
            </h3>
            <div class="docstring plain">~ @debug(0)
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\schedulers.py#L155">View source</a>
    </li>
</ul>
            <h3 id="method-run">
                run
                <span class="args">(self)</span>
            </h3>
            <div class="docstring plain">This is the main loop.
This loop will exit when there are no more coroutines to run or stop has
been called.</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\schedulers.py#L169">View source</a>
    </li>
</ul>
            <h3 id="method-run_timer">
                run_timer
                <span class="args">(self)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\schedulers.py#L100">View source</a>
    </li>
</ul>
            <h3 id="method-stop">
                stop
                <span class="args">(self)</span>
            </h3>
            <div class="docstring plain"></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\schedulers.py#L196">View source</a>
    </li>
</ul>
    </div>
        </div>
        <div id="footer">
            Generated with <a href="http://apydia.ematia.de/" class="extern">
            Apydia 0.0.3</a>
        </div>
    </div>
</body>
</html>